home *** CD-ROM | disk | FTP | other *** search
/ Light / Light_Vol.1_August_1992_Datasphere_Publications_Disk_1_of_2_Side_A.d64 / address change (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  10KB  |  365 lines

  1. 1 rem"********************"
  2. 2 rem"*[195]hange [204]oad adress*"
  3. 3 rem"* by [193]ndrew [198]isher *"
  4. 4 rem"********************"
  5. 10 printchr$(14);chr$(8);"[147][154][204]oading machine code... [208]lease wait..."
  6. 11 a=a+1:ifa=1 thenload"machine code1",8,1
  7. 12 ifa=2 then load"machine code2",8,1
  8. 20 print"[147]";:poke646,peek(53281):print"5 goto100":print"run"
  9. 30 poke198,3:poke631,19:poke632,13:poke633,13:end
  10. 40 print"[154][147][154][197]nter device number ";:inputde$:d=val(de$):ifd<8 or d>12 then40
  11. 41 poke679,d
  12. 42 ifq=1 then goto1101
  13. 43 ifq=2 thengoto1201
  14. 44 ifq=3 then goto 1301
  15. 45 ifq=4 then1351
  16. 46 ifq=5 then1401
  17. 47 ifq=6 then1601
  18. 48 ifq=7then1501
  19. 49 ifq=8then1705
  20. 50 ifq=9 then341
  21. 51 ifq=10 then201
  22. 100 gosub4000:print"[154]      [195]hange [204]oad [193]ddress      "
  23. 101 print"           [196]irectory           "
  24. 102 print"     [196]isk & file commands      "
  25. 103 print"             [209]uit              "
  26. 110 poke700,3:poke701,35:poke702,9:poke703,11:poke704,13:poke705,15
  27. 120 poke706,255:sys52985
  28. 130 z=peek(2)
  29. 140 onzgoto200,1100,700,2500
  30. 150 goto100
  31. 200 rem q=10:goto40
  32. 201 rem clr:de=peek(679)
  33. 210 so$="":print"[197]nter name of file:";
  34. 220 geta$:ifa$=""then220
  35. 230 a=asc(a$):ifa=13 then270
  36. 232 ifa$=chr$(20) then240
  37. 234 if(a<32)or((a>127)and(a<160))then220
  38. 236 iflen(so$)<16 then so$=so$+a$:print":                ";
  39. 237 print":";so$
  40. 238 goto220
  41. 240 iflen(so$)<1 then 220
  42. 250 so$=left$(so$,len(so$)-1)
  43. 252 print"                 ";
  44. 253 iflen(so$)>0 thenprint":";so$
  45. 254 goto220
  46. 270 rem
  47. 295 print"[197]nter load address:";
  48. 296 geta$:ifa$=""then296
  49. 297 a=asc(a$):ifa=13 then308
  50. 298 ifa$=chr$(20)then303
  51. 300 if(a<32)or((a>127)and(a<160))then296
  52. 301 iflen(ad$)<5thenad$=ad$+a$:poke781,5:poke782,19:poke783,0:sys65520:printad$
  53. 302 goto296
  54. 303 iflen(ad$)<1 then296
  55. 304 ad$=left$(ad$,len(ad$)-1)
  56. 305 poke781,5:poke782,19:poke783,0:sys65520:print"     [157][157][157][157][157]";
  57. 306 iflen(ad$)>0thenprintad$
  58. 307 goto296
  59. 308 ifleft$(ad$,1)="$" then 311
  60. 309 ad=val(ad$):h=int(ad/256):l=(ad-h*256)
  61. 310 goto320
  62. 311 h$=right$(ad$,4)
  63. 312 d=0:ifh$>""thenfori=1tolen(h$):a=asc(mid$(h$,i,1))-48:d=d*16+a+(a>9)*7:next
  64. 313 h=int(d/256):l=(d-h*256)
  65. 320 rem
  66. 332 poke781,6:poke782,0:poke783,0:sys65520:print"[195]ontinue?:[217][197][211][146][206][207]":c=1
  67. 333 geti$:ifi$=""then333
  68. 334 ifi$=chr$(17)thenc=1-c
  69. 335 ifi$=chr$(145)thenc=1-c
  70. 336 ifc=1thenpoke781,6:poke782,10:poke783,0:sys65520:print"[217][197][211][146][206][207]"
  71. 337 ifc=0thenpoke781,6:poke782,10:poke783,0:sys65520:print"[146][217][197][211][206][207][146]"
  72. 338 ifi$=chr$(13)thenc=c+1:oncgoto100,340
  73. 339 goto333
  74. 340 q=9:goto40
  75. 341 de=peek(679):d$=so$
  76. 343 print"[211]earching for "d$" - press a key"
  77. 344 poke198,0:wait198,1:poke198,0
  78. 345 sd$="":sd$=d$:fors=1to19:gosub1000:ifj=k thenx=fe:y=s:s=19
  79. 346 nexts:print"[195]hanging load addr. of "d$
  80. 347 open8,de,15:open4,8,4,"#"
  81. 348 bp=(x-1)*32+3:print#8,"u1:"4;0;18;y
  82. 349 print#8,"b-p:"4;bp
  83. 350 tr=asc(t$+chr$(0)):se=asc(s$+chr$(0))
  84. 351 close4:close8
  85. 352 open8,de,15:open4,8,4,"#"
  86. 353 print#8,"u1:"4;0;tr;se
  87. 354 print#8,"b-p:"4;2
  88. 355 print#4,chr$(l);chr$(h);
  89. 356 print#8,"u2:"4;0;tr;se
  90. 376 close4:p=9:goto1503
  91. 377 close8:print"[210]eturning to main menu"
  92. 378 fort=1to500:next:goto100
  93. 699 goto100
  94. 700 gosub3180
  95. 710 poke700,8:poke701,23:poke702,4:poke703,6:poke704,8:poke705,13
  96. 720 poke706,15:poke707,17:poke708,20:poke709,22:poke710,255:sys52985
  97. 730 w=peek(2)
  98. 740 on w goto 1300,1200,1350,1600,1400,1700,1500,750
  99. 750 goto100
  100. 999 end
  101. 1000 forg=1to16-len(sd$)
  102. 1001 sd$=sd$+chr$(160)
  103. 1002 next
  104. 1003 open8,de,15
  105. 1004 open4,de,4,"#"
  106. 1005 print"[147][211]earching sector"s
  107. 1006 forfe=1to8
  108. 1007 print#8,"u1:";4;0;18;s
  109. 1008 bp=(fe-1)*32+2
  110. 1009 print#8,"b-p:"4;bp
  111. 1010 get#4,p$,t$,s$
  112. 1011 tr=asc(t$+chr$(0)):se=asc(s$+chr$(0))
  113. 1012 if(tr=1andse=1)thenfe=8:goto 1020
  114. 1013 x=x+1:get#4,n$
  115. 1014 na$=na$+n$
  116. 1015 ifx<16 then 1013
  117. 1017 goto 1024
  118. 1018 ifj=k then 1021
  119. 1019 goto 1030
  120. 1020 nextfe
  121. 1021 close4:close8
  122. 1022 return
  123. 1023 close4:close8:return
  124. 1024 j=1:fork=1to16
  125. 1025 q=asc(mid$(na$,k,1)+chr$(0))
  126. 1026 w=asc(mid$(sd$,k,1)+chr$(0))
  127. 1027 ifq=w then j=j+1
  128. 1028 nextk
  129. 1029 goto 1018
  130. 1030 na$="":x=0:t$="":s$="":tr=0:se=0:ty$="":q=0:w=0:goto 1020
  131. 1100 q=1:goto40
  132. 1101 clr:de=peek(679):print"[147][201]nsert disk in device"de"& press a key"
  133. 1102 poke198,0:wait198,1:poke198,0:open8,de,15
  134. 1103 print#8,"i"
  135. 1104 open4,de,4,"#"
  136. 1105 print#8,"m-r"chr$(144)chr$(7)chr$(16)
  137. 1106 input#8,x$
  138. 1107 fort=1to19
  139. 1108 print"[147]"spc(6)"[176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
  140. 1109 printspc(6)"[221][196]iskname:[146]"x$" [221]"
  141. 1110 printspc(6)"[171][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][178][192][192][192][192][178][192][192][192][192][179]"
  142. 1111 printspc(6)"[221][198]ile name       [221][212]ype[221][211]ize[221]"
  143. 1112 printspc(6)"[171][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][219][192][192][192][192][219][192][192][192][192][179]"
  144. 1113 print#8,"u1:"4;0;18;t
  145. 1114 foru=1to8
  146. 1115 bp=(u-1)*32+2
  147. 1116 print#8,"b-p:"4;bp
  148. 1117 get#4,p$,t$,s$
  149. 1118 tr=asc(t$+chr$(0)):se=asc(s$+chr$(0))
  150. 1119 if(tr=1andse=1) thenu=8:v=1:goto 1140
  151. 1120 if(tr=0andse=0)thenu=8:goto 1140
  152. 1121 x=x+1:get#4,n$
  153. 1122 na$=na$+n$
  154. 1123 ifx<16 then 1121
  155. 1124 bp=bp+28
  156. 1125 print#8,"b-p:"4;bp
  157. 1126 get#4,l$,h$
  158. 1127 bl=asc(l$+chr$(0))+256*asc(h$+chr$(0))
  159. 1128 p=asc(p$+chr$(0)):p=p-128:ifp>5thenp=p-64
  160. 1129 ifp=1 thenty$="[211]eq":qs=qs+1
  161. 1130 ifp=2 thenty$="[208]rg":qp=qp+1
  162. 1131 ifp=3 thenty$="[213]sr":qu=qu+1
  163. 1132 ifp=4 thenty$="[210]el":qr=qr+1
  164. 1133 ifp<1 thengosub 1159:nextu:goto 1142
  165. 1134 printspc(6)"[221]"na$"[221]";ty$;" [221]";bl;
  166. 1135 ifbl<10thenprint" [221]"
  167. 1136 ifbl>10andbl<100thenprint"[221]"
  168. 1137 ifbl>100thenprint"[157][221]"
  169. 1138 tb=tb+bl
  170. 1139 gosub 1159
  171. 1140 nextu
  172. 1141 ifv=1thenv=0:nextt:goto 1145
  173. 1142 printspc(6)"[173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][177][192][192][192][192][177][192][192][192][192][189]"
  174. 1143 poke198,0:print""spc(6)"[208]ress a key to view next page"
  175. 1144 wait198,1:poke198,0:next
  176. 1145 print"[147][176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
  177. 1146 print"[221][211]tatistics for "x$"[221]"
  178. 1147 print"[173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]"
  179. 1148 n=qp+qr+qs+qu:print"[212]otal number of files:"n
  180. 1149 print"[208]rg files:"qp
  181. 1150 print"[211]eq files:"qs
  182. 1151 print"[210]el files:"qr
  183. 1152 print"[213]sr files:"qu
  184. 1153 print"[194]locks used:"tb
  185. 1154 print"[194]locks free:"664-tb
  186. 1155 print"[208]ress a key to return to main menu"
  187. 1156 poke198,0:wait198,1:poke198,0
  188. 1157 close4:close8
  189. 1158 goto100
  190. 1159 na$="":x=0:ty$="":p$="":p=0:return
  191. 1200 q=2:goto40
  192. 1201 clr:de=peek(679):print"[147][201]nsert disk to format in device"de
  193. 1202 print"& press a key":poke198,0:wait198,1:poke198,0
  194. 1203 open8,de,15:open4,de,4,"#"
  195. 1204 print#8,"u1:"4;0;18;0
  196. 1205 input#8,e
  197. 1206 ife>5then1208
  198. 1207 goto1226
  199. 1208 close4
  200. 1209 print"[147][196]isk needs to be formatted. [201]s this ok"
  201. 1210 inputan$
  202. 1211 ifan$="n"thenclose8:goto700
  203. 1212 ifan$<>"y"then1209
  204. 1213 print"[197]nter disk name and id"
  205. 1214 inputdn$,id$
  206. 1215 print"[147][196]isk to be formatted as "dn$
  207. 1216 print"with id "id$
  208. 1217 input"[201]s this ok";an$
  209. 1218 ifan$="n"then1213
  210. 1219 ifan$<>"y"then1215
  211. 1220 print#8,"n0:"+dn$+","+id$
  212. 1221 open4,de,4,"#"
  213. 1222 print#8,"u1:"4;0;18;0
  214. 1223 input#8,e
  215. 1224 ife>5thenprint"[147][196]isk error!!!":fort=0to1000:next:close8:goto1200
  216. 1225 print"[147][196]isk formatted ok":fort=0to1000:next:close8:goto700
  217. 1226 close4:print"[147][196]isk needs to be cleared"
  218. 1227 print"[201]s this ok";:inputan$
  219. 1228 ifan$="n"thenclose8:goto700
  220. 1229 ifan$<>"y"then1227
  221. 1230 print"[147][201]nput new disk name"
  222. 1231 inputdn$
  223. 1232 print#8,"n0:"+dn$
  224. 1233 open4,de,4,"#"
  225. 1234 print#8,"u1:"4;0;18;0
  226. 1235 input#8,e
  227. 1236 ife>5thenprint"[147][196]isk error!!!":fort=0to1000:next:close8:goto1200
  228. 1237 print"[147][196]isk cleared ok":close8:goto700
  229. 1300 q=3:goto40
  230. 1301 clr:de=peek(679):print"[147][154][201]nsert disk to validate in device"de
  231. 1302 print"[208]ress a key to continue"
  232. 1303 poke198,0:wait198,1:poke198,0
  233. 1304 print"[214]alidating... [208]lease wait..."
  234. 1305 open8,de,15,"v"
  235. 1306 p=3:goto1503
  236. 1308 fort=1to500:next:close8:goto700
  237. 1350 q=4:goto40
  238. 1351 clr:de=peek(679):print"[147][201]nitialising disk in device"de
  239. 1352 print"[208]lease wait..."
  240. 1353 open8,de,15,"i"
  241. 1354 p=4:goto1503
  242. 1355 fort=1to500:next
  243. 1356 close8:goto700
  244. 1400 q=5:goto40
  245. 1401 clr:de=peek(679):print"[147][201]nsert disk in device"de"& press a key"
  246. 1402 poke198,0:wait198,1:poke198,0
  247. 1403 input"[198]ile name";sd$
  248. 1404 print"[201]s sector known?":gosub1438
  249. 1405 ift=0 then t=1
  250. 1406 fors=tto19:gosub1000:ifj=k thenx=s:y=fe:s=19
  251. 1407 nexts:ifx=0 thenprint"[198]ile not found":close4:close8:forg=1to1500:nextg:goto700
  252. 1408 open8,de,15:open4,de,4,"#"
  253. 1409 bp=y-1:bp=bp*32:bp=bp+2
  254. 1410 print#8,"u1:"4;0;18;x
  255. 1411 print#8,"b-p:"4;bp
  256. 1412 get#4,p$:p=asc(p$+chr$(0))
  257. 1413 ifp>135 thenp=p-192:l%=1:goto1426
  258. 1414 ifp>5 thenp=p-128:l%=0
  259. 1415 print"[198]ile is unlocked":print"[196]o you wish to lock it?"
  260. 1416 getk$:ifk$=""then1416
  261. 1417 ifk$<>"y"thengoto1422
  262. 1418 p=p+192:p$=chr$(p)
  263. 1419 print#8,"b-p:"4;bp
  264. 1420 print#4,p$:print#8,"u2:"4;0;18;x
  265. 1421 close4:close8
  266. 1422 print"[193]nother file?"
  267. 1423 getk$:ifk$="" then1423
  268. 1424 ifk$="y" thengoto1400
  269. 1425 close4:close8:goto700
  270. 1426 print"[198]ile is locked":print"[196]o you wish to unlock it?"
  271. 1427 getk$:ifk$=""then1427
  272. 1428 ifk$<>"y" then1433
  273. 1429 print#8,"b-p:"4;bp
  274. 1430 p=p+128:p$=chr$(p)
  275. 1431 print#8,"b-p:"4;bp
  276. 1432 print#4,p$:print#8,"u2:"4;0;18;x
  277. 1433 close4:close8
  278. 1434 print"[193]nother file?"
  279. 1435 getk$:ifk$="" then1435
  280. 1436 ifk$="y" then goto1400
  281. 1437 goto700
  282. 1438 getk$:ifk$=""then1438
  283. 1439 ifk$<>"y"thent=0:return
  284. 1440 print"[211]ector";:inputt:return
  285. 1500 q=7:goto40
  286. 1501 clr:de=peek(679):print"[147][154][197]rror channel of device"de"reads:-"
  287. 1502 open8,de,15
  288. 1503 input#8,en,e$,tr,se
  289. 1504 ifen=1 thenprint""tr" files scratched":goto1508
  290. 1505 ifen=0 thenprint"[196]evice"de"[207][203]":goto1508
  291. 1506 print""e$"at ("tr","se")"
  292. 1507 print"([197]rror number"en")"
  293. 1508 ifp>0 then1511
  294. 1509 print"[208]ress a key to return to disk menu":poke198,0:wait198,1:poke198,0
  295. 1510 close8:goto700
  296. 1511 rem
  297. 1513 ifp=3 then 1308
  298. 1514 ifp=4 then 1355
  299. 1516 ifp=6 then 1609
  300. 1518 ifp=8 then 1730
  301. 1519 ifp=9 then377
  302. 1520 close8:goto700
  303. 1600 q=6
  304. 1601 clr:de=peek(679):print"[147][154][201]nsert disk in device"de"& press a key"
  305. 1602 poke198,0:wait198,1:poke198,0
  306. 1603 input"[198]ile to scratch";f$
  307. 1604 print"[211]cratching "f$:print"[193]re you sure?"
  308. 1605 getk$:ifk$<>"y"andk$<>"n" then1605
  309. 1606 ifk$="n" then 700
  310. 1607 open8,de,15,"s:"+f$
  311. 1608 p=6:goto1503
  312. 1609 print"[193]nother file?"
  313. 1610 getk$:ifk$=""then1610
  314. 1611 ifk$="y"then1601
  315. 1612 close8:goto700
  316. 1700 q=8:goto40
  317. 1705 clr:de=peek(679):print"[147][201]nsert disk in device"de"& press a key"
  318. 1710 print"[198]ile to rename";:inputo$
  319. 1715 print"[206]ew name for "o$;:inputn$
  320. 1720 print"[210]enaming "o$" as "n$
  321. 1725 open8,8,15,"r:"+n$+"="+o$
  322. 1726 p=8:goto1503
  323. 1730 print"[193]nother file?"
  324. 1735 getk$:ifk$=""then1735
  325. 1740 ifk$="y"then1705
  326. 1745 goto700
  327. 2500 print"[147][208]ress b for [194]asic"
  328. 2510 print"[208]ress x to reset"
  329. 2520 print"press r to rerun"
  330. 2530 geta$:ifa$=""then2530
  331. 2540 ifa$="x" then sys64738
  332. 2550 ifa$="r" then run
  333. 2560 ifa$="b" then end
  334. 2570 goto2530
  335. 3180 print"[147]";:poke53280,14:poke53281,6
  336. 3185 poke53265,peek(53265)and191:poke53270,peek(53270)and239
  337. 3190 poke53272,(peek(53272)and240)or6
  338. 3195 printspc(7)"[154][176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]":printspc(7)"[221][196]isk[195]ommands";
  339. 3200 print"{$7d}":printspc(7)"[171]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[179]"
  340. 3205 printspc(7)"{$7d}Validate{$7d}":printspc(7)"{$7d}";
  341. 3210 print"{$7d}":printspc(7)"{$7d}Format{$7d}"
  342. 3215 printspc(7)"{$7d}{$7d}":printspc(7)"{$7d}Initialise";
  343. 3220 print"{$7d}":printspc(7)"{$7d}{$7d}"
  344. 3225 printspc(7)"[171]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[179]":printspc(7)"{$7d}FileCommands";
  345. 3230 print"{$7d}":printspc(7)"[171]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[179]"
  346. 3235 printspc(7)"{$7d}Deletefile{$7d}":printspc(7)"{$7d}";
  347. 3240 print"{$7d}":printspc(7)"{$7d}Check/changeprotection{$7d}"
  348. 3245 printspc(7)"{$7d}{$7d}":printspc(7)"{$7d}Renamefile";
  349. 3250 print"{$7d}":printspc(7)"{$7d}{$7d}"
  350. 3255 printspc(7)"[171]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[179]":printspc(7)"{$7d}ReadErrorChanne";
  351. 3260 print"l{$7d}":printspc(7)"[171]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[179]"
  352. 3265 printspc(7)"{$7d}Quittomainmenu{$7d}":printspc(7)"[173]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}";
  353. 3270 print"{$60}{$60}{$60}[189]"
  354. 3275 return
  355. 4000 print"[154][147][154][176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
  356. 4010 print"[221]                                   [221]"
  357. 4020 print"[221]                                   [221]"
  358. 4030 print"[221]                                   [221]"
  359. 4040 print"[221]                                   [221]"
  360. 4050 print"[221]                                   [221]"
  361. 4060 print"[221]                                   [221]"
  362. 4065 print"[221]                                   [221]"
  363. 4070 print"[173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]"
  364. 4999 return
  365.